var express = require('express');
var router = express.Router();
var Comment = require('../models/comment.js');
var check = require('./check');
var checkLogin = check['checkLogin'];
var checkNotLogin = check['checkNotLogin'];
router.get('/',checkLogin);
router.get('/',function(req,res,next){
  Comment.getAll(function(err,comments){
    if(err){
      console.log(err);
      res.json({"success":false,message:'获取评论失败',comments:[]});
    }else{
      res.json({"success":true,message:'获取评论成功',comments:comments});
    }
  })
});

module.exports = router;